define(function(require){
	var main = require('/static/main.js');
	var m = new main();
	function Cont(){
		this.Fun._init();
	}
	Cont.prototype.Fun = {
		_init:function(){
			this.bindEvent();
		},
		getdetial:function(){
            var _this = this;
			$.ajax({
                type: "POST",
                url: "/site/info",
                dataType: "json",
                success: function (ret) {
                	if(ret.IsBizSuccess){
                        var data = {
                            VIPCnt:ret.VIPCnt,
                            UserCnt:ret.UserCnt,
                            FansCnt:ret.FansCnt,
                        }
                        var data1 = _this.getList(7,ret.SpreadCnt,ret.OrderCnt);
                        _this.getCssOne(100,data);
                        _this.getCssOne(200,data1);

                	}else{
                		
                	}
                }
            });
		},
       
		bindEvent:function(){
          
            $('.login-btn.go').click(function(){
                    var JsonData = {
                        Phone : $.trim($(".user").val()),
                        Password : $.trim($(".pwd").val())
                    }
                    if(JsonData.Phone == ''){
                        layer.msg('手机号码不能为空！');
                        return false;
                    }
                    if(!m.IsPhone(JsonData.Phone)){
                        layer.msg('手机格式不正确！');
                        return false;
                    }
                    if(JsonData.Password == ''){
                        layer.msg('密码不能为空！');
                        return false;
                    }
                    m.ajax(m.baseUrl+'/site/loginin',JsonData,function(ret) {
                        $(".login-btn.go").html("<a href='javascript:;'>正在登录...</a>");
                        if( ret != null && ret.IsBizSuccess){
                            // 到时候切换成正式的 域名
                            window.location.href = "http://192.168.5.174:1014/site/index";
                        }else{
                            layer.msg(ret.ErrMsg);
                            $(".login-btn.go").html("<a href='javascript:;'>登录</a>");
                        }
                    });
            });
		}


	}
	var a = new Cont();

})